package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.NotificationDto;
import xyz.zhouzhaodong.crm.entity.Notification;
import xyz.zhouzhaodong.crm.service.INotificationService;
import xyz.zhouzhaodong.crm.util.NoRepeatSubmit;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 通知书202 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-06-27
 */
@RestController
@RequestMapping("/notification")
public class NotificationController {

    @Resource
    INotificationService notificationService;

    /**
     * 新增
     * @param notificationDto
     * @return
     */
    @NoRepeatSubmit
    @RequestMapping("/add")
    public RestMessage addNotification(NotificationDto notificationDto){
        return notificationService.addNotification(notificationDto);
    }

    /**
     * 删除
     * @param notificationDto
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteNotification(NotificationDto notificationDto){
        return notificationService.deleteNotification(notificationDto);
    }

    /**
     * 修改
     * @param notificationDto
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateNotification(NotificationDto notificationDto){
        return notificationService.updateNotification(notificationDto);
    }

    /**
     * 查询
     * @param notificationDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectNotification(NotificationDto notificationDto){
        return notificationService.selectNotification(notificationDto);
    }
    
}
